package com.inspur.incubator.controller;

import java.net.URLDecoder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import com.inspur.incubator.common.interceptor.Page;
import com.inspur.incubator.common.tools.Numbers;
import com.inspur.incubator.data.ZhibiaoDict;
import com.inspur.incubator.service.ZhibiaoDictService;

@RestController
@RequestMapping("/ZhibiaoDict")
public class ZhibiaoDictController {
	@Resource
	ZhibiaoDictService service;
	
	@RequestMapping(value = "/zhibiaoDict", method = RequestMethod.GET)
	public ModelAndView demandStatus(ZhibiaoDict zhibiaoDict,Page page) throws Exception {
		if(StringUtils.isNotEmpty(zhibiaoDict.getMenu_name()))
		{
			zhibiaoDict.setMenu_name(URLDecoder.decode(zhibiaoDict.getMenu_name(),"UTF-8"));
		}
		List<ZhibiaoDict> list=service.queryAll(zhibiaoDict, page);
		Map<String,Object> map = new HashMap<String, Object>();
		map.put("zhibiao", list);
		map.put("page", page);

		return new ModelAndView("ZhibiaoDict", map);
	}
	
}
